/**
 * Interface for a Frame. Frame format:
 *
 * Byte 0 = header (0x7e)
 * Byte 1 = type
 * Byte 2 = end?
 * Byte 3 - 7 = seq
 * Byte 8 - 12 = ack
 * Byte 13 - 17 = CRC
 * Byte 18 - 20 = length
 * Bytes 21 - 21+Length-1 = Data
 * Bytes 21+length - 21+length+1 = footer (0x7e)
 *
 * @author Timothy Flynn (trflynn@wpi.edu)
 * @version April 10, 2012
 */
#ifndef _FRAME_H_
#define _FRAME_H_

#include "common.h"
#include "Packet.h"

class Frame {
public:
	Frame();
	Frame(char *);
	virtual ~Frame();
	char *toString();

	// Fields intentionally public for convenience
	char type;
	bool end;
	short seq;
	short ack;
	unsigned short crc;
	short length;
	char *data;
};

#endif
